package com.sx.baseproject.framework.adapter.binding;

import android.view.View;

import androidx.databinding.BindingAdapter;

public class ViewBinding {

    @BindingAdapter(value = {"listDate", "loading","hide"},requireAll = false)
    public static void emptyView(View view, Integer size, Boolean loading, boolean hide) {
        if(view!=null){
            if(hide){
                view.setVisibility(View.GONE);
            }else if(loading!=null&&size!=null){
                if(!loading){
                    if(size==0){
                        view.setVisibility(View.VISIBLE);
                    }else{
                        view.setVisibility(View.GONE);
                    }
                }else{
                    view.setVisibility(View.GONE);
                }
            }

        }
    }
}
